package cn.wolfcode.qo;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.util.StringUtils;

@Setter
@Getter//通过Get方法获取参数做回显
@ToString
public class QueryObject {
    //关键字
    private String keyword;
    private int currentPage = 1;
    private int pageSize = 5;

    //方便前端调用,判空
    //trim():去掉字符串两端的多余的空格
    //replaceAll():替换掉空格成字符串
    public String getKeyword(){
        if (StringUtils.hasText(keyword)){
            return keyword.replaceAll("","");
        }
        return null;
    }
    /*//定义获取当前开始页数的方法
    public int getStart(){
        return (currentPage - 1) * pageSize;
    }*/
}
